function http(url,params,data){
    let beasUrl='https://api-hmugo-web.itheima.net/api/public/v1/'
    wx.showLoading({
      title: '加载中',
    })
    return new Promise((resolve,reject)=>{
      wx.request({
        url: beasUrl+url,
        ...params,
        data:data,
        //设置请求头
        header:{
          Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIzLCJpYXQiOjE1NjQ3MzAwNzksImV4cCI6MTAwMTU2NDczMDA3OH0.YPt-XeLnjV-_1ITaXGY2FhxmCe4NvXuRnRB8OMCfnPo"
        },
        success(res){
          resolve(res)
        },
        fail(err){
          reject(err)
        },
        complete:()=>{
          wx.hideLoading()
        }
      })
    })
  }
  export {http}